import re
from python_baway.common.xcommon import xshow_list, sep, xshow_table

xtext = """\
Ross McFluff: 834.345.1254 155 Elm Street

Ronald Heathmore: 892.345.3428 436 Finley Avenue
Frank Burger: 925.541.7625 662 South Dogwood Way


Heather Albrecht: 548.326.4584 919 Park Place"""

sep('split function')
xentries = re.split(r'\n+', xtext)
xshow_list(xentries)

sep('split method')
xreg_splitter = re.compile(r'\n+')
xentries2 = xreg_splitter.split(xtext)
print(xentries2 == xentries)

xphone_book = [re.split(r':?\s+', line, 4) for line in xentries]
xshow_table(xphone_book)
